<?php

class DestaquesView extends Destaques{
	
	public function listar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){
				echo '<tr>';
					echo '<td width="80%">',$arr[$i]['titulo'],'</td>';
				//	echo '<td width="20%" align="center" onclick="javascript:editar(',$arr[$i]['iddestaques'],',\'destaques\');" class="tabelaB"><img src="images/app-edit-icon.png" width="20" align="absmiddle" /> Editar</td>';
					echo '<td width="20%" id="editar" align="center" onclick="javascript:excluir(',$arr[$i]['iddestaques'],',\'Destaques\');" class="tabelaB"><img src="images/app-delete-icon.png" width="20" align="absmiddle" /> Excluir</td>';
				echo '</tr>';
	    }
	}
	public function visualizar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){
			echo '<a href="posts.php?i=',$arr[$i]['idposts'],'">';
			if($i+1 == $total){
				echo '<li class="last" style="background:url(class/thumb.php?img=../imagens/galeria/',$arr[$i]['imagem0'],'&w=350&h=350) no-repeat;">';
			}else{
				echo '<li style="background:url(class/thumb.php?img=../imagens/galeria/',$arr[$i]['imagem0'],'&w=350&h=350) no-repeat;">';
			}
				echo '<div class="cor_',$arr[$i]['idcategorias'],'_bg chamada_blog"><table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0"><tr><td>',$arr[$i]['titulo'],'</td></tr></table></div>';
			echo '</li>';
			echo '</a>';
		}
	}
}
?>